home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / gui / skin / gcbug.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  49 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import wx
  5. if __name__ == '__main__':
  6.     a = wx.PySimpleApp()
  7.     f = wx.Frame(None)
  8.     fix = False
  9.     
  10.     def drawrect(dc, x, y, round = False):
  11.         dc.SetBrush(wx.WHITE_BRUSH)
  12.         dc.SetPen(wx.TRANSPARENT_PEN)
  13.         (w, h) = (30, 30)
  14.         if round:
  15.             dc.DrawRoundedRectangle(x, y, w, h, 5)
  16.         else:
  17.             dc.DrawRectangle(x, y, w, h)
  18.  
  19.     
  20.     def paint(e):
  21.         dc = wx.BufferedPaintDC(f)
  22.         gc = wx.GraphicsContext.Create(dc)
  23.         if fix:
  24.             gc.Translate(-0.5, -0.5)
  25.         
  26.         dc.Brush = wx.BLACK_BRUSH
  27.         dc.Pen = wx.TRANSPARENT_PEN
  28.         dc.DrawRectangleRect(wx.RectS(f.ClientSize))
  29.         drawrect(dc, 10, 35)
  30.         drawrect(gc, 40, 35)
  31.         drawrect(dc, 70, 35, True)
  32.         drawrect(gc, 100, 35, True)
  33.  
  34.     
  35.     def button(e):
  36.         global fix
  37.         fix = not fix
  38.         f.Refresh()
  39.  
  40.     f.Bind(wx.EVT_PAINT, paint)
  41.     f.Bind(wx.EVT_ERASE_BACKGROUND, (lambda e: pass))
  42.     f.Sizer = wx.BoxSizer(wx.VERTICAL)
  43.     b = wx.Button(f, -1, 'toggle fix')
  44.     f.Sizer.Add(b)
  45.     b.Bind(wx.EVT_BUTTON, button)
  46.     f.Show()
  47.     a.MainLoop()
  48.  
  49.